package app.travel.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.BasicRowProcessor;
import org.apache.commons.dbutils.BeanProcessor;

public class SimpleRowProcessor extends BasicRowProcessor {

	private static final BeanProcessor defaultConvert = new SimpleBeanProcessor();
	private final BeanProcessor convert;

	public SimpleRowProcessor() {
		this(defaultConvert);
	}

	public SimpleRowProcessor(BeanProcessor convert) {
		this.convert = convert;
	}

	@Override
	public <T> List<T> toBeanList(ResultSet rs, Class<T> type) throws SQLException {
		return this.convert.toBeanList(rs, type);
	}

}
